<template>
  <div class="project-management">
    <!-- 左侧导航栏 -->
    <div class="sidebar">
      <ul class="menu-list">
        <li 
          v-for="(item, index) in menuItems" 
          :key="index"
          :class="{ active: $route.path.includes(item.path) }"
          @click="switchMenu(item.path)"
        >
          {{ item.label }}
        </li>
      </ul>
    </div>

    <!-- 右侧内容区 -->
    <div class="content">
      <router-view></router-view>
    </div>
  </div>
</template>

<script>
export default {
  name: 'ProjectManagement',
  data() {
    return {
      menuItems: [
        { path: 'application', label: '项目申请' },
        { path: 'approval', label: '项目审批' },
        { path: 'products', label: '项目产品' },
        { path: 'projects', label: '我的项目' },
      ]
    }
  },
  methods: {
    switchMenu(path) {
      this.$router.push(`/project/${path}`)
    }
  }
}
</script>

<style scoped>
.project-management {
  display: flex;
  height: 100%;
  min-height: calc(100vh - 60px);
}

.sidebar {
  width: 200px;
  background-color: #f5f7fa;
  border-right: 1px solid #e6e6e6;
  padding: 20px 0;
}

.menu-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.menu-list li {
  padding: 12px 20px;
  cursor: pointer;
  transition: all 0.3s;
}

.menu-list li:hover {
  background-color: #ecf5ff;
}

.menu-list li.active {
  background-color: #409eff;
  color: white;
}

.content {
  flex: 1;
  padding: 20px;
}
</style>
